package com.buaa.xxx0313;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.SeekBar;
import android.widget.Spinner;

public class MainActivity extends AppCompatActivity implements SeekBar.OnSeekBarChangeListener{

    private SeekBar sb;
    private ImageView iv1;
    private AutoCompleteTextView av1;
    private Spinner sp1;
    private ListView lv1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.w_layout);
        sb = (SeekBar) findViewById(R.id.sb);
        iv1 = (ImageView) findViewById(R.id.iv1);
        av1 = (AutoCompleteTextView)findViewById(R.id.av1);
        sp1 = (Spinner)findViewById(R.id.sp1);
        lv1 = (ListView)findViewById(R.id.lv1);
        sb.setOnSeekBarChangeListener(this);
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_expandable_list_item_1,new String[]{"abc","acdgs","bcd","cde"});
        av1.setAdapter(adapter);

        sp1.setAdapter(adapter);
        lv1.setAdapter(adapter);

    }

    @Override
    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
        iv1.setAlpha(progress/100.0f);
        Log.i("xxx", progress +",..........");
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {

    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {

    }
}
